import React, {
    useRef,
    useLayoutEffect,
    useCallback,
    useState,
    useContext
} from 'react'
import ChildCom from './ChildCom'
import GlobalContext from '../../utils/getGlobalContext'

// 用户评论页面
export default function UserCommon() {
    document.title = '用户评论'
    const context = useContext(GlobalContext)
    console.log('context:', context)
    function onClickFn() {
        context.dispatch({
            type: 'userInfo',
            value: '蒋皓天'
        })
        console.log('context111:', context)
    }
    return (
        <div>
            <div>UserCommon</div>
            <button onClick={() => {
                onClickFn()
            }}>触发</button>
            <ChildCom></ChildCom>
        </div>
    )
}
